home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / OpenDoc Utilities / Interfaces / StdTypIO.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  6.6 KB  |  201 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        StdTypIO.h
  3.  
  4.     Contains:    functions for read/writing standard typed values from/to storage units
  5.  
  6.     Owned by:    Nick Pilch
  7.  
  8.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  9.         
  10.     Change History (most recent first):
  11.  
  12.          <3>    11.09.1996    NP        fixed comments only
  13.          <2>     5/24/96    jpa        1.1MRD: pragma internal
  14.  
  15.  The philosophy of StdTypIO is to give the client of the standard type IO
  16.  functions flexibility with respect to where the data is stored while providing
  17.  a standard for the data format used to store the types of data used in the
  18.  various pieces of OpenDoc metadata in order to facilitate document exchange.  
  19.  
  20.  The standard type IO functions are designed to be used independent of property
  21.  & value type, and in some/most cases can even be used to manipulate data
  22.  midstream (in the middle of values) by passing in a prefocused storageunit
  23.  along with the offset set correctly, and passing in kODNULL for the prop and
  24.  the val params.  
  25.   
  26. */
  27.  
  28. #ifndef _STDTYPIO_
  29. #define _STDTYPIO_
  30.  
  31.  
  32. #ifndef _ODTYPES_
  33. #include <ODTypes.h>
  34. #endif
  35.  
  36. //==============================================================================
  37. // Classes used by this interface
  38. //==============================================================================
  39.  
  40. #ifdef __cplusplus
  41.     class    ODStorageUnit;
  42.     class    ODTypeList;
  43. #else
  44.     #ifndef SOM_ODStorageUnit_h
  45.     #include <StorageU.h>
  46.     #endif
  47. #endif
  48.  
  49. //==============================================================================
  50. // Function prototypes
  51. //==============================================================================
  52.  
  53. #ifdef _OD_IMPL_SHARE_UTILS_
  54. #pragma import on
  55. #elif defined(PRAGMA_INTERNAL_SUPPORTED)
  56. #pragma internal on
  57. #endif
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. ODBoolean    ODGetBooleanProp(Environment* ev,
  64.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  65. void        ODSetBooleanProp(Environment* ev,
  66.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  67.                 ODBoolean value);
  68.  
  69. ODUShort    ODGetUShortProp(Environment* ev,
  70.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  71. void        ODSetUShortProp(Environment* ev,
  72.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  73.                 ODUShort value);
  74.  
  75. ODSShort    ODGetSShortProp(Environment* ev,
  76.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  77. void        ODSetSShortProp(Environment* ev,
  78.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  79.                 ODSShort value);
  80.  
  81. ODULong        ODGetULongProp(Environment* ev,
  82.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  83. void        ODSetULongProp(Environment* ev,
  84.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  85.                 ODULong value);
  86.  
  87. ODSLong        ODGetSLongProp(Environment* ev,
  88.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  89. void        ODSetSLongProp(Environment* ev,
  90.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  91.                 ODSLong value);
  92.  
  93. ODISOStr    ODGetISOStrProp(Environment* ev,
  94.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  95.                 ODISOStr value, ODULong* size);
  96. void        ODSetISOStrProp(Environment* ev,
  97.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  98.                 ODISOStr value);
  99.  
  100. void        ODGetTypeListProp(Environment* ev,
  101.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  102.                 ODTypeList* typeList);
  103. void        ODSetTypeListProp(Environment* ev,
  104.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  105.                 ODTypeList* typeList);
  106.  
  107. // ODGetITextProp works as follows: the value returned is that of the
  108. // name param passed in if name is not null.  If name is null, a structure of
  109. // the necessary size is allocated.
  110.  
  111. ODIText*    ODGetITextProp(Environment* ev,
  112.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  113.                 ODIText* name);
  114. void        ODSetITextProp(Environment* ev,
  115.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  116.                 ODIText* name);
  117.  
  118. ODTime        ODGetTime_TProp(Environment* ev,
  119.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  120. void        ODSetTime_TProp(Environment* ev,
  121.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  122.                 ODTime value);
  123.  
  124. ODPoint*    ODGetPointProp(Environment* ev,
  125.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  126.                 ODPoint* value);
  127. void        ODSetPointProp(Environment* ev,
  128.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  129.                 ODPoint* value);
  130.  
  131. ODRect*        ODGetRectProp(Environment* ev,
  132.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  133.                 ODRect* value);
  134. void        ODSetRectProp(Environment* ev,
  135.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  136.                 ODRect* value);
  137.  
  138. ODID        ODGetStrongSURefProp(Environment* ev,
  139.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  140. void        ODSetStrongSURefProp(Environment* ev,
  141.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  142.                 ODID id);
  143.  
  144. ODID        ODGetWeakSURefProp(Environment* ev,
  145.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val);
  146. void        ODSetWeakSURefProp(Environment* ev,
  147.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  148.                 ODID id);
  149.  
  150. ODPolygon*    ODGetPolygonProp(Environment* ev,
  151.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  152.                 ODPolygon* value);
  153. void        ODSetPolygonProp(Environment* ev,
  154.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  155.                 const ODPolygon* value);
  156.  
  157. ODMatrix*    ODGetMatrixProp(Environment* ev,
  158.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  159.                 ODMatrix* value);
  160. void        ODSetMatrixProp(Environment* ev,
  161.                 ODStorageUnit* su, ODPropertyName prop, ODValueType val,
  162.                 ODMatrix* value);
  163.  
  164. //--------------------------------------------------------------------
  165. // Icon Family I/O
  166. //--------------------------------------------------------------------
  167.  
  168. // Note: ODIconFamily is a platform specific type, so these two functions
  169. // will have platform specific implementations. -TÇ
  170.  
  171. enum {                            // For use with iconMask parameter:
  172.     kAllIconsMask     = 0xFFFFFFFF,    // All icons usable on this platform
  173.     kBWIconsMask      = 0x0421        // 1 bit deep, 16,32,64 pixels wide
  174. };
  175.  
  176. /*    Expected values for the ODValueType begin with "OpenDoc:Type:IconFamily:"
  177.     followed by the name of a platform. These are defined in StdTypes.idl as
  178.     kODIconFamilyMac, kODIconFamilyWin, kODIconFamilyOS2, kODIconFamilyAIX, etc.
  179.     If you only specify kODIconFamily, the current platform's type will be used.
  180. */
  181.  
  182. ODIconFamily    ODGetIconFamilyProp(Environment* ev,
  183.                     ODStorageUnit* su, ODPropertyName prop, 
  184.                     ODValueType val, ODULong iconMask);
  185. void            ODSetIconFamilyProp(Environment* ev,
  186.                     ODStorageUnit* su, ODPropertyName prop, 
  187.                     ODValueType val, ODIconFamily iconFamily,
  188.                     ODBoolean deleteOtherPlatformIcons);
  189.  
  190. #ifdef __cplusplus
  191. } /* extern "C" */
  192. #endif
  193.  
  194. #ifdef _OD_IMPL_SHARE_UTILS_
  195. #pragma import off
  196. #elif defined(PRAGMA_INTERNAL_SUPPORTED)
  197. #pragma internal reset
  198. #endif
  199.  
  200. #endif // _STDTYPIO_
  201.